var t = require("../../../../../@babel/runtime/helpers/defineProperty"), e = getApp();

Component({
    properties: {
        goods_info: {
            type: null
        }
    },
    data: {
        radio: "",
        type: "lawyer",
        listData: []
    },
    observers: {
        goods_info: function(t) {
            if (console.log(t), 0 !== t.length) {
                var e = [];
                e = 1 == t.length ? t : t.filter(function(t) {
                    return null == t.status || "tel" == t.service_data.type && 1 == t.status || "line" == t.service_data.type ? t : void 0;
                }), this.triggerEvent("lawyerChange", e[0]), this.setData({
                    listData: t,
                    radio: e[0].id
                });
            }
        }
    },
    methods: {
        link: function(t) {
            var e = t.currentTarget.dataset.id, a = t.currentTarget.dataset.type;
            wx.navigateTo({
                url: "/packageI/lawyerPlatform/detail/detail?id=".concat(e, "&type_name=").concat(a)
            });
        },
        onChange: function(a) {
            var i = this;
            this.data.listData.forEach(function(r, n) {
                r.id == a.detail && 0 == r.status && "tel" == r.service_data.type && (r.disabled = !0, 
                i.setData(t({}, "listData[" + n + "].disabled", !0)), e.tips("律师休息，暂不能购买电话咨询服务"));
            }), this.setData({
                radio: a.detail
            });
            var r = this.data.listData.filter(function(t) {
                return t.id == a.detail;
            });
            this.triggerEvent("lawyerChange", r[0]);
        }
    }
});